package com.hl.mapper;

import com.hl.pojo.Timu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TimuMapper {
    @Insert("insert into timu (title, text, cp_id) value (#{title},#{text},#{cpId})")
    public Integer add(Timu timu);

    @Delete("delete from timu where id = #{id}")
    public Integer del(Timu timu);
    @Delete("delete from timu where cp_id = #{cpId}")
    public Integer delType(Timu timu);
    @Select("select * from timu")
    public List<Timu> findAll();
    @Select("select * from timu where cp_id = #{cpId}")
    public List<Timu> findType(Timu timu);
}
